import { defineStore } from "pinia";

export const useLayoutHeaderStore = defineStore("layoutHeader", {
    state: () => ({
        title: "应用标题",
        backgroundColor: "transparent",
        showBackBtn: false,
        isShowDddBtn: false,
    }),
    actions: {
        setTitle(title: any) {
            this.title = title;
        },
        isShowBackBtn(flag: boolean) {
            this.showBackBtn = flag;
        },
        setBackgroundColor(color: any) {
            this.backgroundColor = color;
        },
        removeBackgroundColor() {
            this.backgroundColor = "transparent";
        },
        useDefault() {
            this.backgroundColor = "transparent"
            this.showBackBtn = false;
            this.isShowDddBtn = false;
        }
    }
});